package com.dfbz.demo01;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo10_自定义异常测试 {
    public static void main(String[] args) {

        test();
        System.out.println("1111111");
    }

    public static void test() {
        Boolean flag = true;

        if (flag) {
            try {
                throw new MyException("出现了我们自己的编译时异常...");
            } catch (MyException e) {
                e.printStackTrace();
            }
        }
        System.out.println("aaa");

    }


    public static void method() throws MyRuntimeException {
        Boolean flag = true;

        if (flag) {
            throw new MyRuntimeException("出现了我们自己的运行时异常...");
        }
        System.out.println("aaa");

    }
}
